#include					"ApiNetwork.h"

ApiNetwork::ApiNetwork(NetworkManager & controller) : _controller(controller)
{

}

ApiNetwork::~ApiNetwork()
{

}

void						ApiNetwork::UdpSend(IOrder *order)
{
	_controller.SendToUdp(order);
}

void						ApiNetwork::TcpSend(IOrder *order)
{
	_controller.SendToTcp(order);
}

IOrder						*ApiNetwork::getIOrder() const
{
	Order					*order = new Order;
	order->setData(new std::vector<byte>);
	return order;
}

void						ApiNetwork::ConnectToClient(std::string ip, std::string port)
{
	_controller.udpServer().connectToClient(ip, port);
}

void						ApiNetwork::disconnect(unsigned int id)
{
	_controller.udpServer().disconnect(id);
}
